package com.xielaoban.his1.controller;

import com.xielaoban.his1.common.ServerResponse;
import com.xielaoban.his1.model.Fmeditem;
import com.xielaoban.his1.service.IFmeditemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;


@RestController
@RequestMapping(value = "/his1/fmeditem/")
public class FmeditemController {
    @Autowired
    IFmeditemService iFmeditemService;

    @RequestMapping(value = "qurryAll.do")
    public ServerResponse qurryAll(@RequestParam(value = "pagenum",defaultValue = "1")int pagenum,@RequestParam(value = "pagesize",defaultValue = "5")int pagesize){
        return iFmeditemService.qurryAll(pagenum,pagesize);
    }
    @RequestMapping(value = "qurryOneById.do")
    public ServerResponse qurryOneById(@RequestParam("Id")int Id){
        return iFmeditemService.qurryOneById(Id);
    }
    @RequestMapping(value = "insertOne.do")
    public ServerResponse insertOne(Fmeditem fmeditem){
        return iFmeditemService.insertOne(fmeditem);
    }
    @RequestMapping(value = "deleteOneById.do")
    public ServerResponse deleteOneById(@RequestParam("Id")int Id){
        return iFmeditemService.deleteOneById(Id);
    }
    @RequestMapping(value = "updateOne.do")
    public ServerResponse updateOne(Fmeditem fmeditem){
        return iFmeditemService.updateOne(fmeditem);
    }

    @RequestMapping("search.do")
    public ServerResponse qurryByDeptCodeAndDeptName(@RequestParam(value = "keywords")String keywords,@RequestParam(value = "pagenum",defaultValue = "1")int pagenum,@RequestParam(value = "pagesize",defaultValue = "10")int pagesize){
        return iFmeditemService.qurryByItemCodeOrItemName(keywords,pagenum,pagesize);
    }
}
